package com.azzaou.service.impl;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import com.azzaou.dao.IUserDao;
import com.azzaou.model.User;
import com.azzaou.service.IUserService;

/**
 * UserService
 */
public class UserService implements IUserService,
    Serializable

    {
  /**
   * 
   */
  private static final long serialVersionUID = 1L;
  
  /**
   * userDao
   */
  IUserDao userDao;

  public void setuserDao(IUserDao puserDao)
  {
    this.userDao = puserDao;
  }

  public void saveOrUpdate(User User)
  {
    userDao.saveOrUpdate(User);
  }

  @Override
  public List<User>  getAllUsers()
  {
    return userDao.getAllUsers();
  }

  @Override
  public void deleteUsers(List<Long> listId)
  {
    userDao.deleteUsers(listId);
  }

  @Override
  public Map<Integer, List<User>> getListUsers(int startRecord, int maxPerPage)
  {
    return userDao.getListUsers(startRecord, maxPerPage);
  }

  @Override
  public boolean isUserExist(String login)
  {
    return userDao.isUserExist(login);
  }

  @Override
  public List<User> getUserByCreteria(User user) {
    	return userDao.getUserByCreteria(user);
  }

  @Override
  public User login(String login, String password) {
    	return userDao.login(login, password); 
  }

  @Override
  public void delete(User user) {
	  userDao.delete(user);
  }

}
